import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

import 'lib-flexible'
import 'font-awesome/css/font-awesome.min.css'
Vue.config.productionTip = false

// 全局引入 echarts
import * as echarts from 'echarts'
// 将 echarts 挂载到 Vue 上
Vue.prototype.$echarts = echarts
//防止重复点击路由报错
import Router from 'vue-router'
const routerPush = Router.prototype.push
Router.prototype.push = function push(location) {
  return routerPush.call(this, location).catch(error => error)
}
// import Vant from 'vant'
// import 'vant/lib/index.css'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import axios from 'axios'
import i18n from './i18n/i18n';
Vue.use(ElementUI)

new Vue({
  router,
  store,
  i18n,
  render: h => h(App)
}).$mount('#app')
// router.beforeEach((to, from, next) => {
//   if (to.meta.title) {
//     document.title = to.meta.title
//   }
//   next()
// })

// axios.interceptors.request.use(function(config){
//   let token=localStorage.getItem('e_token')
//   if(token){
//     config.headers['e_token']=token
//   }
//   return config
// })